package com.jieao.content.dto;

import com.jieao.content.domain.Article;
import com.jieao.content.domain.ArticleSub;
import com.jieao.framework.util.ShiroUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * @Description
 * @Author weifanl
 * @Date2020/5/26 13:40
 **/
@Data
@EqualsAndHashCode(callSuper=true)
public class ArticleDto extends Article {
    private String catalogName;
    private String lastArticleName;
    private String nextArticleName;

    private String content;

    private Integer likesNum;           //文章喜欢数

    private Integer isLiked;

    private Long parentId;
    private boolean nocheck;

    public ArticleDto(){
        setDelFlag(0);

        setUpdateBy(ShiroUtils.getLoginName());
        setUpdateTime(new Date());
    }
    public ArticleSub createArticleSub(){
        return  new ArticleSub(content);
    }

}
